IF EXISTS (SELECT * FROM dbo.sysobjects WHERE NAME = 'sp_InsertRole')
BEGIN
	DROP PROC sp_InsertRole
END
GO
CREATE PROC sp_InsertRole
	@ID					INT,
	@Name				VARCHAR(40),
	@Last_updated		datetime,
	@RESULT				INT OUT 
AS
BEGIN
	IF NOT EXISTS (SELECT * FROM ROLE WHERE @ID = ID)
	BEGIN
		insert into ROLE values(@Name,@Last_updated)
			SET @RESULT = 1
	END
	ELSE 
	BEGIN
		SET @RESULT = 0
	END
END
